#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include "UdpThread.h"
#include "TimerControlThread.h"
#include <QDateTime>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

private:
    Ui::MainWindow *ui;
    UdpThread *udpThread;
    TimerControlThread* m_timerThread;
    QByteArray timearray;
    QDateTime myDateTime;
    void initView();
    void initTimeSetTimer();
    bool isLocalIp(const QString& myIp);

private slots:
    void onMessageReceived(const QByteArray& message, const QHostAddress& address, quint16 port);
    void on_pushButton_10_clicked();
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_7_clicked();
    void on_pushButton_3_clicked();
    void on_pushButton_4_clicked();
    void on_pushButton_5_clicked();
    void on_pushButton_6_clicked();
    void onTimerTimeout();
    void onTimerStatusChanged(bool isRunning);
    void on_horizontalSlider_sliderReleased();
    void on_horizontalSlider_2_sliderReleased();
    void on_pushButton_9_clicked();
    void on_pushButton_12_clicked();
    void on_pushButton_11_clicked();
    void on_pushButton_13_clicked();
    void on_pushButton_14_clicked();
    void on_pushButton_15_clicked();
    void on_pushButton_16_clicked();
    void on_pushButton_8_clicked();
    void on_horizontalSlider_3_sliderReleased();
};
#endif // MAINWINDOW_H
